import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './assets/main.scss'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import axios from 'axios'

const app = createApp(App)



for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}


app.use(createPinia())
app.use(router)
app.use(ElementPlus)

// //全局配置axios
// //配置基础URL
// axios.defaults.baseURL = 'http://127.0.0.1:5000'
// //启用跨域请求时携带凭据 如cookies，http认证等
// axios.defaults.withCredentials = true

// //将配置好的 Axios 实例添加到 Vue 应用的全局属性中
// app.config.globalProperties.$axios = axios

app.mount('#app')
